//    The page gives admin the functionality to View/add/update  minimum Bidding  per specilaity      
//    The data will be used from the tbl_specialitys table.                                
//    Author: Rupinder Saini                                                                    
//    Date: May 15,2006  

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SiteManager;
using System.Data.SqlClient;


public partial class Admin_Ad_ManageBidding : System.Web.UI.Page
{
    // creating an instance of manager class
    Manager mgr = new Manager(true,"ConnectionString");

    protected void Page_Load(object sender, EventArgs e)
    {

        lblMsg.Text = "";
        if (!Page.IsPostBack)
        {
            // bind the grid
            BindGridView();
        }

    }
    // Paging
    protected void grdbid_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        grdbid.PageIndex = e.NewPageIndex;
        BindGridView();

    }

    #region general functions

    /// <summary>
    /// this function binds the grid view
    /// </summary>
    public void BindGridView()
    {
        try
        {
            SqlParameter[] sqlParam = new SqlParameter[0];
            DataSet ds = mgr.ExecuteQuery("get_bidding", sqlParam, "tbl");
            if (ds.Tables[0].Rows.Count > 0)
            {
                grdbid.DataSource = ds;
                grdbid.DataBind();
            }
            else
            {
                lblMsg.Visible = true;
                lblMsg.Text = "No Records found!!";
                lblMsg.ForeColor = System.Drawing.Color.Red;
            }
        }
        catch (Exception ex)
        {
            lblMsg.Visible = true;
            lblMsg.Text=ex.ToString();
        }
    }

    #endregion
}
